package com.raymond.client.netty;

import com.raymond.client.enums.NettyEventType;
import io.netty.channel.Channel;

/**
 * netty事件
 *
 * @author :  raymond
 * @version :  V1.0
 * @date :  2022-11-13 11:42
 */
public class NettyEvent {
    /**
     * 事件类型
     */
    private final NettyEventType type;
    /**
     * 远程地址
     */
    private final String remoteAddr;
    /**
     * 连接的channel
     */
    private final Channel channel;

    public NettyEvent(NettyEventType type, String remoteAddr, Channel channel) {
        this.type = type;
        this.remoteAddr = remoteAddr;
        this.channel = channel;
    }

    public NettyEventType getType() {
        return type;
    }

    public String getRemoteAddr() {
        return remoteAddr;
    }

    public Channel getChannel() {
        return channel;
    }

    @Override
    public String toString() {
        return "NettyEvent [type=" + type + ", remoteAddr=" + remoteAddr + ", channel=" + channel + "]";
    }
}
